package com.ocom.emqx.client;

import com.ocom.common.constant.PayConfigUrl;
import com.ocom.common.entity.payconfig.EntityMqttDevice;
import com.ocom.common.request.emqx.DeviceStartWorkRequest;
import com.ocom.common.request.emqx.DeviceStopWorkRequest;
import com.ocom.common.request.emqx.TimerMqttOrderRequest;
import com.ocom.common.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "payconfig")
public interface PayconfigFeignService {

    @PostMapping(PayConfigUrl.URL_getMqttDeviceInfo)
    public Result<EntityMqttDevice> getMqttDeviceInfo(@RequestParam("deviceNo") String deviceNo) ;


    @PostMapping(PayConfigUrl.URL_updateMqttDevice)
    public Result updateByDeviceNo(@RequestBody EntityMqttDevice entityMqttDevice) ;


    @PostMapping(PayConfigUrl.URL_updateMqttDeviceOnline)
    public Result updateMqttDeviceOnline(@RequestBody List<String> devices) ;


    @PostMapping(PayConfigUrl.URL_deviceStartWork)
    public Result deviceStartWork(@RequestBody DeviceStartWorkRequest request);

    @PostMapping(PayConfigUrl.URL_deviceStopWork)
    public Result deviceStopWork(@RequestBody DeviceStopWorkRequest request);

    @PostMapping(PayConfigUrl.URL_timerMqttOrder)
    public Result timerMqttOrder(@RequestBody TimerMqttOrderRequest request);
}

